package basicPackage;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;
import be.kuleuven.cs.som.annotate.Raw;

/**
 * This enumeration represents the different directions
 * in which dungeon objects can border each other.
 * These directions are the 4 cardinal directions and floor and ceiling.
 * They each have an opposite direction.
 * 
 * @author Frederik
 *
 */
public enum Direction {
	
	NORTH {
		public Direction getOppositeDirection(){
			return Direction.SOUTH;
		}
	},
	EAST {
		public Direction getOppositeDirection(){
			return Direction.WEST;
		}
	},
	SOUTH {
		public Direction getOppositeDirection(){
			return Direction.NORTH;
		}
	},
	WEST {
		public Direction getOppositeDirection(){
			return Direction.EAST;
		}
	},
	FLOOR {
		public Direction getOppositeDirection(){
			return Direction.CEILING;
		}
	},
	CEILING {
		public Direction getOppositeDirection(){
			return Direction.FLOOR;
		}
	};
	
	public abstract Direction getOppositeDirection();
	
	/**
	 * Return the number of directions.
	 * 
	 * @return		The number of directions.
	 * 				| result = 6
	 */
	@Basic @Raw @Immutable
	public static int getNbOfDirections(){
		return nbOfDirections;
	}
	
	/**
	 * The number of possible directions.
	 */
	private static final int nbOfDirections = values().length;
}
